****************************
*** Science Policy Forum ***
*** Roach & Skrentny     ***
*** Dec. 10, 2020        ***
****************************

** "Rethinking immigration poicies for STEM doctorates"

** NOTES
* Data for this study are the Science & Engineering PhD Panel Survey developed and administered by Michael Roach & Henry Sauermann (2010, 2013, 2016, 2018 and 2019)
* Data and Stata code are to be used solely for the purpose of replicating the results in Roach & Skrentny 2021.  No other use of data are permitted.
* Stata code are to replicate regression tables reported in the Supporting Materials

** FIG 1 **
tab visa_first_broad if visa_progression==1
tab visa_current if visa_progression==1

** Table S2 **
tab visa_first_broad visa_current if visa_progression==1

************************
*****   TABLE S6   *****
************************
reg ln_pubs_at_grad i.visa_h1b_vs_eb male pre_married pre_children i.job_year i.field, cluster(university)
est store TABLE_S6_01

reg ln_patents_at_grad i.visa_h1b_vs_eb male pre_married pre_children i.job_year i.field, cluster(university)
est store TABLE_S6_02

reg ln_starting_salary i.visa_h1b_vs_eb male pre_married pre_children emplr_startup i.job_year i.field, cluster(university)
est store TABLE_S6_03

*reg ln_wage_offer2 i.entry_visa_opt years_to_file emplr_startup i.mainfield2 i.phd_year, cluster(university)
*est store TABLE_S6_PERM

estout TABLE_S6* using "/Users/michaelroach/Dropbox/Immigration studies/04_H1B_EB/Science_TABLE_S6.csv", margin equations("") starlevels(+ 0.10 * 0.05 ** 0.01 *** 0.0011) cells(b(star fmt(%9.2f)) se(par fmt(%9.2f))) stats(r2 N) style(tab) prefoot("") unstack replace


************************
*****   TABLE S7   *****
************************
reg ln_starting_salary i.visa_foreign nrc_dept_rank ln_pre_publications ln_pre_patents pre_postdoc male pre_married pre_children emplr_startup firm_stock i.job_year field01-field17 [pw=sample_weight_SDR_field], cluster(university)
est store TABLE_S7_01

reg ln_starting_salary i.visa_h1b nrc_dept_rank ln_pre_publications ln_pre_patents pre_postdoc male pre_married pre_children emplr_startup firm_stock i.job_year field01-field17 [pw=sample_weight_SDR_field], cluster(university)
est store TABLE_S7_02

reg ln_starting_salary nrc_dept_rank ln_pre_publications ln_pre_patents pre_postdoc male pre_married pre_children emplr_startup firm_stock i.job_year field01-field17 if visa_h1b==0 [pw=sample_weight_SDR_field], cluster(university)
est store TABLE_S7_03

reg ln_starting_salary nrc_dept_rank ln_pre_publications ln_pre_patents pre_postdoc male pre_married pre_children emplr_startup firm_stock i.job_year field01-field17 if visa_h1b==1 [pw=sample_weight_SDR_field], cluster(university)
est store TABLE_S7_04

estout TABLE_S7_* using "/Users/michaelroach/Dropbox/Immigration studies/04_H1B_EB/Science_TABLE_S7.csv", margin equations("") starlevels(+ 0.10 * 0.05 ** 0.01 *** 0.0011) cells(b(star fmt(%9.2f)) se(par fmt(%9.2f))) stats(r2 N) style(tab) prefoot("") unstack replace


************************
*****   TABLE S8   *****
************************
** BIO/LIFE **
reg ln_starting_salary i.visa_h1b nrc_dept_rank ln_pre_publications ln_pre_patents pre_postdoc male pre_married pre_children emplr_startup firm_stock i.job_year field01-field06 if mainfield==2 [pw=sample_weight_SDR_field], cluster(university)
est store TABLE_S8_bio

** CHEM **
reg ln_starting_salary i.visa_h1b nrc_dept_rank ln_pre_publications ln_pre_patents pre_postdoc male pre_married pre_children emplr_startup firm_stock i.job_year if mainfield==3 [pw=sample_weight_SDR_field], cluster(university)
est store TABLE_S8_chem

** PHYS **
reg ln_starting_salary i.visa_h1b nrc_dept_rank ln_pre_publications ln_pre_patents pre_postdoc male pre_married pre_children emplr_startup firm_stock i.job_year if mainfield==4 [pw=sample_weight_SDR_field], cluster(university)
est store TABLE_S8_phys

** ENGR **
reg ln_starting_salary i.visa_h1b nrc_dept_rank ln_pre_publications ln_pre_patents pre_postdoc male pre_married pre_children emplr_startup firm_stock i.job_year field11-field15 if mainfield==5 [pw=sample_weight_SDR_field], cluster(university)
est store TABLE_S8_engr

** CS **
reg ln_starting_salary i.visa_h1b nrc_dept_rank ln_pre_publications ln_pre_patents pre_postdoc male pre_married pre_children emplr_startup firm_stock i.job_year if mainfield==6 [pw=sample_weight_SDR_field], cluster(university)
est store TABLE_S8_cs

estout TABLE_S8* using "/Users/michaelroach/Dropbox/Immigration studies/04_H1B_EB/Science_TABLE_S8.csv", margin equations("") starlevels(+ 0.10 * 0.05 ** 0.01 *** 0.0011) cells(b(star fmt(%9.2f)) se(par fmt(%9.2f))) stats(r2 N) style(tab) prefoot("") unstack replace


************************
*****   TABLE S9   *****
************************
reg hrswork i.visa_h1b ln_starting_salary emplr_big_tech nrc_dept_rank pre_postdoc male pre_married pre_children emplr_startup i.job_year i.field [pw=sample_weight_SDR_field], cluster(university)
est store TABLE_S9_01

reg firm_stock i.visa_h1b emplr_big_tech ln_starting_salary nrc_dept_rank pre_postdoc male pre_married pre_children emplr_startup i.job_year i.field [pw=sample_weight_SDR_field], cluster(university)
est store TABLE_S9_02

reg firm_stock i.visa_h1b ln_starting_salary nrc_dept_rank pre_postdoc male pre_married pre_children emplr_startup i.job_year field01 field02 field05-field17 if emplr_big_tech==1 [pw=sample_weight_SDR_field], cluster(university)
est store TABLE_S9_03

reg emplr_big_tech i.visa_h1b  ln_starting_salary nrc_dept_rank pre_postdoc male pre_married pre_children job_2010-job_2016 i.field [pw=sample_weight_SDR_field], cluster(university)
est store TABLE_S9_04

reg ln_starting_salary i.visa_h1b nrc_dept_rank ln_pre_publications ln_pre_patents pre_postdoc male pre_married pre_children emplr_startup i.job_year field01 field02 field05-field17 if emplr_big_tech==1 [pw=sample_weight_SDR_field], cluster(university)
est store TABLE_S9_05

estout TABLE_S9_* using "/Users/michaelroach/Dropbox/Immigration studies/04_H1B_EB/Science_TABLE_S9.csv", margin equations("") starlevels(* 0.05 ** 0.01 *** 0.0011) cells(b(star fmt(%9.2f)) se(par fmt(%9.2f))) stats(r2 N) style(tab) prefoot("") unstack replace


